<template>
  <div class="settings-page">
    <van-nav-bar title="设置" left-text="返回" @click="goBack" />
    <van-cell-group>
      <van-cell title="个人资料" @click="geren" />
    </van-cell-group>
    <van-cell-group>
      <van-cell title="账号与安全" @click="goToAccountSafety" />
    </van-cell-group>
    <van-cell-group>
      <van-cell title="地址管理" @click="shou" />
    </van-cell-group>
    <van-cell-group>
      <van-cell title="消息设置" @click="xiaoxi" />
    </van-cell-group>
    <!-- <van-button type="primary" block @click="logout">退出账号</van-button> -->
    <van-button type="primary" block class="logout-button" @click="logout">
      退出账号</van-button>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router';
const router = useRouter();
const goToAccountSafety = () => router.push('/account-safety');
const geren = () => router.push('/geren');
const shou = () => router.push('/shou');
const xiaoxi = () => router.push('/xiaoxi');
const goBack = () => router.back();
const logout = () => {
  // 在这里添加退出账号的逻辑，例如清除本地存储的用户信息，然后跳转到登录页面
  console.log('退出账号');
};
</script>

<style scoped>
/* 设置页样式 */
.logout-button {
  margin-top: 160px;
  background-color: #007bff;
  color: white;
  text-align: center;
  padding: 10px;
  border-radius: 50px;
}
</style>